package com.zl.rbac.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zl.rbac.entity.Permission;

import java.io.Serializable;
import java.util.List;

/**
 * 公共的业务类接口
 * @InterfaceName: IBaseService
 * @author: suke
 * @since: 2021/1/12 9:28
 */
public interface IBaseService<T> {
    /**
     *
     * @Title: 分页查询
     * @param pageIndex  当前页
     * @param pageSize  页容量
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.zl.rbac.entity.Permission>
     * @author: suke
     * @since: 2021/1/11 15:17
     */
    public Page<T> queryByPage(Integer pageIndex, Integer pageSize) throws Exception ;

    /**
     *
     * @Title: 删除
     * @param id  删除id
     * @return void
     * @author: suke
     * @since: 2021/1/11 15:37
     */
    public  void delete(Serializable id) throws Exception;


    /**
     *
     * @Title: 添加
     * @param t: 需要添加的对象
     * @return void
     * @author: suke
     * @since: 2021/1/12 9:33
     */
    public void  save(T t) throws Exception;


    /**
     *
     * @Title: 修改
     * @param t: 需要修改的对象
     * @return void
     * @author: suke
     * @since: 2021/1/12 9:33
     */
    public  void   update(T t) throws  Exception;


    /**
     * 
     * @Title: 根据主键查询
     * @param id  主键
     * @return T   对象
     * @author: suke
     * @since: 2021/1/12 9:34
     */
    public T queryById(Serializable id) throws  Exception;

    /**
     *
     * @Title: 查询所有
     * @return List<T>     list集合对象
     * @author: suke
     * @since: 2021/1/12 9:34
     */
    public List<T> queryAll() throws Exception;
}
